From: Thibaut VARÈNE Date: Thu, 28 Jun 2018 10:22:52 +0000 (+0200) Subject: phase1: set rsync timeouts X-Git-Tag: v1~127 X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22http:/www.crowdsec.net/%22/%22https:/collectd.org/%22http:/www.crowdsec.net/%22?a=commitdiff_plain;h=72bdbbce337f7fb79242e5957066188edb63d0b8;p=buildbot.git phase1: set rsync timeouts Regardless of the timeout settings of buildbot or the use of 'pv' to circumvent them, it is desirable to ensure that rsync will fail if the connection hangs or cannot be established for any reason. Otherwise, we might end up with builders stuck on network transfers. This commit sets data transfer timeout to 120s and connection timeout to 20s. Signed-off-by: Thibaut VARÈNE --- diff --git a/phase1/master.cfg b/phase1/master.cfg index 54a5761..118e867 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -901,7 +901,7 @@ for target in targets: factory.addStep(ShellCommand( name = "dirupload", description = "Uploading directory structure", - command = ["rsync", "-4", "-az", "tmp/upload/", "%s/" %(rsync_bin_url)], + command = ["rsync", "-4", "--timeout=120", "--contimeout=20", "-az", "tmp/upload/", "%s/" %(rsync_bin_url)], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = True, logEnviron = False, @@ -911,7 +911,7 @@ for target in targets: factory.addStep(ShellCommand( name = "target-sha256sums", description = "Fetching remote sha256sums for target", - command = ["rsync", "-4", "-vz", Interpolate("%(kw:rsyncbinurl)s/targets/%(kw:target)s/%(kw:subtarget)s/sha256sums", rsyncbinurl=rsync_bin_url, target=ts[0], subtarget=ts[1]), "target-sha256sums"], + command = ["rsync", "-4", "--timeout=120", "--contimeout=20", "-vz", Interpolate("%(kw:rsyncbinurl)s/targets/%(kw:target)s/%(kw:subtarget)s/sha256sums", rsyncbinurl=rsync_bin_url, target=ts[0], subtarget=ts[1]), "target-sha256sums"], env={'RSYNC_PASSWORD': rsync_bin_key}, logEnviron = False, haltOnFailure = False, @@ -945,7 +945,7 @@ for target in targets: factory.addStep(ShellCommand( name = "targetupload", description = "Uploading target files", - command=["../rsync.sh", "-4", "--exclude=/kmods/", "--files-from=rsynclist", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--exclude=/kmods/", "--files-from=rsynclist", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-a", Interpolate("bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/", target=ts[0], subtarget=ts[1]), Interpolate("%(kw:rsyncbinurl)s/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s/", rsyncbinurl=rsync_bin_url, target=ts[0], subtarget=ts[1], prefix=GetVersionPrefix)], env={'RSYNC_PASSWORD': rsync_bin_key}, @@ -957,7 +957,7 @@ for target in targets: factory.addStep(ShellCommand( name = "targetprune", description = "Pruning target files", - command=["../rsync.sh", "-4", "--exclude=/kmods/", "--delete", "--existing", "--ignore-existing", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--exclude=/kmods/", "--delete", "--existing", "--ignore-existing", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-a", Interpolate("bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/", target=ts[0], subtarget=ts[1]), Interpolate("%(kw:rsyncbinurl)s/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s/", rsyncbinurl=rsync_bin_url, target=ts[0], subtarget=ts[1], prefix=GetVersionPrefix)], env={'RSYNC_PASSWORD': rsync_bin_key}, @@ -969,7 +969,7 @@ for target in targets: factory.addStep(ShellCommand( name = "kmodupload", description = "Uploading kmod archive", - command=["../rsync.sh", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-a", Interpolate("bin/targets/%(kw:target)s/%(kw:subtarget)s%(prop:libc)s/kmods/%(prop:kernelversion)s/", target=ts[0], subtarget=ts[1]), Interpolate("%(kw:rsyncbinurl)s/%(kw:prefix)stargets/%(kw:target)s/%(kw:subtarget)s/kmods/%(prop:kernelversion)s/", rsyncbinurl=rsync_bin_url, target=ts[0], subtarget=ts[1], prefix=GetVersionPrefix)], env={'RSYNC_PASSWORD': rsync_bin_key}, @@ -981,7 +981,7 @@ for target in targets: factory.addStep(ShellCommand( name = "sourceupload", description = "Uploading source archives", - command=["../rsync.sh", "-4", "--size-only", "--delay-updates", + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--size-only", "--delay-updates", Interpolate("--partial-dir=.~tmp~%(kw:target)s~%(kw:subtarget)s~%(prop:slavename)s", target=ts[0], subtarget=ts[1]), "-a", "dl/", "%s/" %(rsync_src_url)], env={'RSYNC_PASSWORD': rsync_src_key}, haltOnFailure = True, @@ -992,7 +992,7 @@ for target in targets: factory.addStep(ShellCommand( name = "packageupload", description = "Uploading package files", - command=["../rsync.sh", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-a", "bin/packages/", "%s/packages/" %(rsync_bin_url)], + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-a", "bin/packages/", "%s/packages/" %(rsync_bin_url)], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, logEnviron = False, @@ -1003,7 +1003,7 @@ for target in targets: factory.addStep(ShellCommand( name = "upload", description = "Uploading logs", - command=["../rsync.sh", "-4", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-az", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], + command=["../rsync.sh", "-4", "--timeout=120", "--contimeout=20", "--delete", "--delay-updates", "--partial-dir=.~tmp~%s~%s" %(ts[0], ts[1]), "-az", "logs/", "%s/logs/%s/%s/" %(rsync_bin_url, ts[0], ts[1])], env={'RSYNC_PASSWORD': rsync_bin_key}, haltOnFailure = False, alwaysRun = True,